Rio de Janeiro -LRB- CNN -RRB- -- Soldiers in full combat gear move silently through a sprawling shantytown in northern Rio de Janeiro , pointing weapons down narrow alleys and poking through sacks of cement in search of drugs .

Residents walk by , barely looking at the troops sent in to occupy the Complexo da Mare as an emergency response to escalating violence in the city 's notorious favelas .

Some 2,500 army troops and marines have moved in to reinforce police in an operation aimed at securing the slum , home to 130,000 people , ahead of the World Cup , which runs from June 12 to July 13 . .

Seizing control from drug gangs was deemed a priority because the shantytown lies just a few kilometers from Rio 's international airport .

`` It 's not a peaceful operation because we have three different criminal gangs here and they are rivals , '' Gen. Roberto Escoto told CNN .

The Rio state government requested the army occupation after a series of attacks against police posts . The troops will remain until at least July 31 , after the World Cup ends , Escoto said .

`` It 's an emergency , '' Escoto said . `` The state police so far do n't have enough policeman and enough equipment to operate in all the city . ''

It 's also the latest campaign in Rio 's so-called `` pacification '' program launched in 2008 . Officials say that after neglecting security in the city 's poorest neighborhoods for decades , police have now seized control from drug gangs in dozens of slums .

While soldiers have provided support during the initial campaign , they have been replaced by police posts in most operations .

But for the Complexo da Mare , officials decided more drastic measures were needed .

Unlike many of the favelas that cling to the hills near Rio 's picturesque beaches , the Complexo da Mare is a sprawling , mostly flat shantytown that combines 15 different neighborhoods in the city 's smoggy north zone .

Cement-block houses are covered with colorful graffiti and loops of tangled wire hang overhead , evidence of the do-it-yourself electricity that powers most homes .

Schoolchildren play soccer on a synthetic-turf court while residents sit at plastic tables set up in the street , drinking beer and listening to music blast over speakers , seemingly oblivious to the heavily armed soldiers who march by .

When asked , they refuse to talk about the military occupation .

Troops have set up checkpoints at the entrances to the favela and patrol the streets on foot and in armored personnel carriers . Soldiers with metal detectors and trained dogs search for hidden caches of arms or drugs .

So far , they have registered more than a half dozen gun battles .

The resurgence in violence in some of the favelas already pacified has raised alarms in a city that will host many of the 600,000 international fans attending the World Cup . Rio also will host the Olympic Games in 2016 .

Tourists strolling along Copacabana Beach at the other end of the city said they were taking precautions , but not overly worried .

Peter , a Belgian businessman in town for a conference , said he was given a brochure with a list of security suggestions when he arrived . `` I feel safe here , but I know where not to go , '' he said .

Simon , a Danish exchange student , agreed that a little knowledge goes a long way . `` Use common sense , grab a cab in the evening , '' he said . `` Do n't use public transportation at night . ''

In the Complexo da Mare , Escoto said the military will have everything under control .

`` I can assure you that Brazil has conducted a very well-planned operation to secure the 12 cities , '' he said .

`` Rio de Janeiro will be prepared for the World Cup , '' he added , before his aides whisked him off , part of their policy never to let their top commander stay in one place for long in hostile territory .

@highlight

Brazil army tackles drug gangs in sprawling slum

@highlight

Complexo de Mare , home to 130,000 people , is also home to drug rings

@highlight

General in charge says Rio de Janeiro will be prepared for the World Cup

@highlight

Then he is whisked away by guards who do n't let him stay in hostile territory for long